package org.grottarossa.ui.core.casemanagement;

import org.grottarossa.template.data.pojo.table.Record;
import org.grottarossa.template.drivers.components.tokens.DocumentManagementId;
import org.grottarossa.ui.core.ApplicationSession;
import org.grottarossa.ui.core.base.BasePanel;
import org.grottarossa.ui.core.layout.EmptyPanel;
import org.grottarossa.ui.core.layout.LayoutFactory;


import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;

public class FileStoreManagementPanel extends BasePanel
{

	public FileStoreManagementPanel(ApplicationSession appSession, DocumentManagementId id, HorizontalLayout buttonsBar, String layoutName)
	 throws Exception
	{
		super(appSession, null);
		init(id, buttonsBar, layoutName);
	}

	private void init(DocumentManagementId id, HorizontalLayout buttonsBar, String layoutName) throws Exception
	{
		VerticalLayout vl = new VerticalLayout();
		vl.setWidth(100, Sizeable.UNITS_PERCENTAGE);
		vl.setHeight(100, Sizeable.UNITS_PERCENTAGE);
		setLayout(vl);

		Record record;
		Component component;

		component = (Component) m_appSession.getLayoutFactory().createLayout(
				layoutName, new Class[] { Record.class, Layout.class},  new Object[] { id, buttonsBar} );

		component.setWidth(100, Sizeable.UNITS_PERCENTAGE);
		component.setHeight(100, Sizeable.UNITS_PERCENTAGE);

		vl.addComponent(component);
		vl.addComponent(buttonsBar);
		vl.setExpandRatio(component, 1000);
		vl.setExpandRatio(buttonsBar, 1);
	}

	@Override
	protected void initializeComponents() {
		// TODO Auto-generated method stub

	}

}
